#!/bin/bash

Install_Git() {
	#install dependency packages
	for Package in zlib-devel perl-CPAN gettext curl-devel expat-devel gettext-devel openssl-devel
	do
		yum -y install $Package
	done

	cd $oneinstack_dir/src
	src_url=https://www.kernel.org/pub/software/scm/git/git-$git_version.tar.gz && Download_src

	tar xzf git-$git_version.tar.gz
	cd git-$git_version
	./configure --prefix=$git_install_dir
	make && make install

	if [ -e "$git_install_dir/bin/git" ];then
	    cd ..
	    rm -rf git-$git_version
	    ln -s $git_install_dir/bin/git /usr/bin/git
	    echo "${CSUCCESS}Git install successfully! ${CEND}"
	else
	    rm -rf $git_install_dir
	    echo "${CFAILURE}Git install failed, Please Contact the author! ${CEND}" 
	    kill -9 $$
	fi

}